#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2022/10/13 16:14
# @Author  : afraidbenq
# @File    : main.py
# @Software: PyCharm
# @Github  : github/afraidbenq
# @Email   : 329189987@qq.com
# @Desc    :
import pytest
import os
from multiprocessing import Pool

device_infos = [
    {
        "platform_version": "5.1.1",
        "server_port": "4723",
        "device_port": "62001",
    },
    {
        "platform_version": "5.1.1",
        "server_port": "4725",
        "device_port": "62025",
    }
]


def main(device_info):
    pytest.main(["--cmdopt={}".format(device_info),
                 "--alluredir", "./allure-results", "-vs"])
    os.system("allure generate allure-results -o allure-report --clean")


if __name__ == "__main__":
    with Pool(2) as pool:
        pool.map(main, device_infos)
        pool.close()
        pool.join()
